package com.mall.common.config;

import com.mall.common.interceptor.CustomerInterceptor;
import lombok.AllArgsConstructor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@AllArgsConstructor
@Configuration
public class InterceptorConfig implements WebMvcConfigurer {

    private final CustomerInterceptor customerInterceptor;


    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(customerInterceptor).addPathPatterns("/**");
    }
}
